<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>红鸽咨询</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="js/core.js"></script>
	<script type="text/javascript" src="js/jquery.blockUI.js"></script>			
	<script type="text/javascript" charset="gbk" src="js/variable.js"></script>
	<link rel="stylesheet" href="../../../css/demo.css" type="text/css">
	<link rel="stylesheet" href="js/zTree v3.1/css/zTreeStyle/zTreeStyle.css" type="text/css">
	<script type="text/javascript" src="js/zTree v3.1/js/jquery.ztree.core-3.1.min.js"></script>
	<script type="text/javascript" src="js/zTree v3.1/js/jquery.ztree.excheck-3.1.min.js"></script>
	<script type="text/javascript" src="js/jquery.form.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<style type="text/css">
		.top_td3{
			  font-size:0.8em;
			  color:#969696;  
			  vertical-align:bottom;
			  text-align:right;
			  /*
			border-style: solid;
			border-width: 1px;
			border-color:red;
			*/
		}
		.select_top_2{
			  font-size:12px;
			  color:#969696;  
			  vertical-align:bottom;
			width:100%;
			height:auto;
			background-color:#FFFFFF;
		}
		.select_top_3{
			width:100%;
			height:auto;
			margin-top:0px;
		}
		.select_top_4{
			margin-top:1px;
			width:100%;
			height:auto;
		}
		.select_top_5{
		margin-top:1px;
			width:100%;
			height:auto;
		}
		.select_top_6{
			width:100%;
			height:auto;
		}

		.zq_table{
			width:100%;
			background-color:#EDFEFF;
			font-size:12px;
			text-align:left;
		}
		.zq_td1{
			text-align:center;
			color:red;
		}
		.core_table{
			width:100%;
			background-color:#F6FEFE;
			font-size:12px;
			text-align:left;
		}
		.sub_table{
			width:100%;
			background-color:#EDFEFF;
			font-size:12px;
			text-align:left;			
		}
		.logo_top{
			width:98%;
			background-color:#EFEFEF;
			font-size:12px;
			text-algin:right;
			margin-top:1px;
			
		}
		.logo_top li{
			padding-right:20px;
			float:right;
		}
		li a{
			text-decoration: none;
			color:#308DFE;
		}
		.div_td{
			width:200px;
			height:300px;
			background-color:#FFFFFF;
			position:absolute;
			left:0px;
			top:0px;
			z-index:2001;
		}
		.div_td li{
			margin-left:20px;
			list-style-type: none;
				
		}
		.MainBody_table2 {
			font-family: "宋体";
			font-size: 13px;
			color: #333333;
			width: 100%;
			line-height: 20px;
			text-align: justify;
		}
		
		.div_ui_td{
			border-style: solid;
			border-width: 1px;
			border-color:red;			
		}	
		.td_m{
			font-family: "宋体";
			font-size: 13px;
			font-width:2em;
			color: #0000FF;
			border-collapse: collapse;
			background-color:#C8E2B1;
			width:100px;
		}	
		.td_c{
			background-color:#C8E2B1;
			width:100px;
		}
		.add_table{
			width:100%;
			background-color:#E0EEE0;
			font-family: "宋体";
			font-size: 13px;
		}	
		.td_add_div{
			width:100px;
		}
		.even{
	background:#FFFFFF;
	
}
.odd{
	background:#DEEFF7;
}  
.selected{
	background:#2CB0E7;
}
.selected2{
background:#2CB0E7;
}
		
	#customers
  {
  font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
  width:100%;
  border-collapse:collapse;
  background-color:#FFFFFF;
  }
#customers td, #customers th 
  {
  font-size:0.8em;
  border:1px solid #D6D7E7;
  padding:3px 7px 2px 7px;
  white-space: nowrap;
  }
  
#customers th 
  {
  font-size:0.9em;
  text-align:center;
  padding-top:5px;
  padding-bottom:4px;
  background-color:#FFFFFF;
  color:#31869C;
  }

#customers tr.alt td 
  {
  color:#000000;
  text-align:center;
  background-color:#FFFFFF;
  
  }
	.sort_th{
	width:130px;
		color: #FFFFFF;
		cursor:pointer;	
	background-image:url(images/self/monitor_019.png);
	background-position:  right;
	background-repeat:no-repeat;
}
.sort_th2{
	width:130px;
	background-image:url(images/self/monitor_013.png);
	background-position:  right;
	background-repeat:no-repeat;
}	
.login_txt1{
	background-color:#FFFFFF;
	width: 180px;
	height: 28px;
	border: 1px solid #D9D9D9;
	border-top: 1px solid silver;
	font-size:18px;
	border-radius: 1px;		
	font-family: 宋体;
}
		</style>
		<link rel="stylesheet" type="text/css" href="css/mainPage.css">
		<link rel="stylesheet" type="text/css" href="css/page.css">
  </head>
  
  <body >
  <div id="body_div" >
	<jsp:include page="/common/top.jsp"></jsp:include>
    <jsp:include page="/common/logo.jsp"></jsp:include>
    <jsp:include page="/common/search.jsp"></jsp:include>
    <div id="main_body_div" class="main_body_div">
    <!-- 
    	<div id="div_sub" style="width:90%;height:15px;text-align:center;overflow:hidden;">
    	</div>
     -->
    <div id="author_div" class="author_div">
    	<div id="left_1" class="left_1">
				<div class="lf_1_1">
							<a href="main/div.jsp">快速发文路径</a>
				</div>
						<div class="lf_1_2" style="list-style-type: none;line-height:180%">
							<li style="color:#F4B525;font-size:13px;list-style-position: outside;padding-left:5px">特约发稿快递</li>
							<li><a href="javascript:fawen(1);">科学家路径 </a></li>
							<li><a href="javascript:fawen(2);">专家路径 </a></li>
							<li><a href="javascript:fawen(3);">青年学者路径</a></li>
							<li><a href="javascript:fawen(4);">晋升路径 </a></li>
							<li><a href="javascript:fawen(5);">首发路径</a></li>
							<li style="list-style-position: outside;padding-left:5px" ><a href="businessProcessMainAction!preTestSuccess.action" style="color:#F4B525;font-size:13px;">测评投稿匹配度</a></li>
							<li style="list-style-position: outside;padding-left:5px"><a href="businessProcessMainAction!preRecommended.action" style="color:#F4B525;font-size:13px;">文章发表推荐系统</a></li>
						</div>
		</div>
    	<div id="left_2" class="left_2">
				<div id="main_body_left" class="main_body_left">
					<div class="lf_1_1">选刊操作</div>
    					<table style="background-color:#D0FEFE;color:#0066FF;font-size:14px">
    						<tr><td><a style="text-decoration: none;"; href="javascript:testOK();">测评发稿成功率</a></td></tr>
    					</table>
    					<table >
    						<tbody id="c_table"></tbody>
    					</table>
    					<table>
    					<tr>
    							<td>
    								<input type="button" name="combutton" class="com_button" value="对比分析" onclick="compare();"/>
    							</td>
    						</tr>
    					</table>
    				</div>
		</div>
    </div>
    <div id="select_div" class="select_div">
    	<div id="select_top" class="select_top">
    		<div id="select_top_1" class="select_top_1">
    			<table width="100%">
    				<tr  height="20px">
    					<td class="top_td0">所有刊物分类</td>
    					<td class="top_td" colspan='99' >
    					</td>
    				</tr>
    			</table>
    		</div>
    		<div id="select_top_2" class="select_top_2">
    			<table width="98%" >
    				<tr >
    					<td width="20px" ></td>
	    				<td style="font-size:12px"  colspan='99'>
	    				<input type="checkbox" value="2BA" name="coreCheck" id="coreCheck0" checked="true" onclick="choseCore(0);"/><label for="coreCheck0"><font size="2" >科学技术类 |</font></label>
						<input type="checkbox" value="2BB" name="coreCheck" id="coreCheck1" checked="true"  onclick="choseCore(1);"/><label for="coreCheck1">人文科学</label>
	    				</td>
					</tr>
				</table>
    		</div>
    		<div id="select_top_3" class="select_top_3">
    			<table  class="zq_table">
    				<tr>
    					<td style="width:20px;height:40px;background-color:C5D4F3">周期</td>
    					<td class="zq_td1">预计发表周期：</td><td>
    					<input type="checkbox" name="fabiao" id="fabiao1" checked='true'  value="1EA"/><label for="fabiao1">1个月以内</label>&nbsp&nbsp
    					<input type="checkbox" name="fabiao" id="fabiao2" checked='true'  value="1EB"/><label for="fabiao2">3个月以内</label>&nbsp&nbsp
    					<input type="checkbox" name="fabiao" id="fabiao3" checked='true'  value="1EC"/><label for="fabiao3">3-6个月</label>&nbsp&nbsp
    					<input type="checkbox" name="fabiao" id="fabiao4" checked='true'  value="1ED"/><label for="fabiao4">6-9个月</label>&nbsp&nbsp
    					<input type="checkbox" name="fabiao" id="fabiao5" checked='true'  value="1EE"/><label for="fabiao5">9-12个月</label>&nbsp&nbsp
    					<input type="checkbox" name="fabiao" id="fabiao6" checked='true'  value="1EF"/><label for="fabiao6">1-1.5年</label>&nbsp&nbsp
    					<input type="checkbox" name="fabiao" id="fabiao7" checked='true'  value="1EG"/><label for="fabiao7">1.5年以上</label></td>
    				</tr>
    			</table>
    		</div>
    		<div id="select_top_4" class="select_top_4">
    			<table class="core_table">
    				<tr id="tr_core1">
    					<td rowspan='2' style="width:20px;background-color:E7EDFB">核心</td>
    					<td style="width:140px"><input type="checkbox" id="core1" name="coreItem" checked='true' value="10001"/><label id="core1">SCI科学引文索引</label></td>
    					<td style="width:140px"><input type="checkbox"  id="core2" name="coreItem"  checked='true'  value="10002"/>EI工程索引</td>
    					<td ><input type="checkbox"  id="core3" name="coreItem"  checked='true'  value="10003"/>MedLine医学索引</td>
    					<td style="width:240px"><input type="checkbox" name="coreItem"  checked='true'  value="10010"/>中文社会科学引文索引(CSSCI)</td>
    					
    					
    				</tr>
    				<tr id="tr_core2">
    					<td><input type="checkbox" name="coreItem"  checked='true'  value="10004"/>北大中文核心期刊</td>
    					<td><input type="checkbox" name="coreItem"  checked='true'  value="10005"/>中国科学引文数据库</td>
    					<td><input type="checkbox" name="coreItem"  checked='true'  value="10006"/>中国核心期刊引证报告</td>
    					<td style="width:180px"><input type="checkbox" name="coreItem"  checked='true'  value="10012"/>中国人文社会科学引文数据库</td>
    					
    				</tr>
    				<tr id="tr_core4" style="display:none">
    				</tr>
    			</table>
			</div>

   	<div style="display:none"> <!-- 保证table一直是隐藏的 -->
   		<table id="div1" class="MainBody_table2">
   			<tbody id="tbody_1" class="">
	   			<tr>
					<td colspan='99' style="text-align:right">
					<input type="button" value="确定" onclick="closeMainDiv();"/>
					<input type="button" value="关闭" onclick="closeMainDiv();"/></td>
				</tr>
   				<tr id="tr_div_top">
   					<td rowspan='2'>选择的学科:</td>
   				</tr>
   				<tr id="tr_div_top2" >
   				</tr>
   			
   			</tbody>
   		</table>
   		<input type="hidden" name="ccType" id="ccType"/>
   		<input type="hidden" name="cc" id="cc"/>
   		<div id="div2" style="float:left;width:600px;height:480px;margin-left:10px;overflow-y:auto;">
   				<div id="d_title"style="width:100%;text-align:center;margin-top:2px"></div>
   				<hr>
				<div id="tree_div" style="width:180px;height:400px;float:left;BORDER-RIGHT: #999999 1px dashed;overflow-y:auto;">
					<ul id="treeDemo" class="ztree"></ul>
				</div>
				<div id="tree_text" style="margin-top:10px;border-style:solid;border-width:1px;border-color:#09D59D;overflow-y:auto;color:#0000FF;text-align:left;font-size:12px">
					
				</div>
				<div>
					<input type="button" value="确定" onclick="closeMainDiv();"/>
					<input type="button" value="关闭" onclick="closeMainDiv();"/>
				</div>
			</div>
   		</div>
   		
   		<div id="div3" style="display:none">
   			<form id="form3" action="">
    			<ul style="list-style-type: none;text-align:center">
    				<li style="text-center;margin-bottom:5px"><b>请输入用户名和密码</b></li>
	   				<li>用户名：<input type="text" class="login_txt1" id="custName" name="custName" value=""/></li>
	   				<li>密  码：<input type="password" class="login_txt1" id="passWord" name="passWord" value=""/></li>
	   				<li style="margin-top:5px;text-align:center">
	   					<input type="button" value="登 录" onclick="loginUser();">
	   					
	   					<input type="button" style="margin-left:20px" value="取 消" onclick="loginOut();">
	   				</li>
	   				<li style="text-align:right">
	   					<a href="businessProcessMainAction!preUserRegister.action">注册新用户</a>
	   				</li>
   				</ul>  			
   			</form>
   		</div>
    		<div id="select_top_5" class="select_top_5">
				<table class="sub_table">
					<tr>
						<td rowspan='2' style="width:20px;background-color:E7EDFB">学科</td>
						<td id="td_pos" style="width:140px;">
						<a  href="javascript:selectSub(1);" style="margin-left:30px;color:#0000FF">教育部分类法</a></td>
						<td style="width:140px" >
						<a href="javascript:selectSub(2);" style="margin-left:30px;color:#0000FF">中图分类法</a></td>
						<td colspan='3'>
						</td>
					</tr>
					<tr id="tr_sub" >
					</tr>
					<tr>
						<td>
							<div id="more_div"></div>
						</td>
					</tr>
				</table>
			</div>
    				<div id="div_sub" style="height:40px;overflow-y:auto">
    				<!-- 
    					<div style="height:100%;float:left;margin-left:0px;text-align:left;">
    						<span>所选学科</span><input type="text"  id="div_sub" style="height:30px;width:80%;background-color:#FFFFFF" />
    					</div>
    				 -->
					</div>
    	</div>
    	<div id="div_iframe" class="div_iframe" >
    		<div id="main_title" class="main_title">
				<table style="width:100%;">
					<tr height="20px"><td class="top_td0">所有刊物一览</td>
						<td class="top_td" colspan='99' style="font-size:12px" ><span id="span_1" style="color:#969696;"></span></td>
					</tr>
				</table>
			</div>
    			<div id="main_body" class="main_body" >
    				<div id="main_body_center" class="main_body_center" style="overflow-x:auto;overflow-y:auto;">
	    				<table id="customers" style="text-align:center;width:100%" >
	    					<tbody id="tbody1">
	    						<tr id="tr_title" style="height:30px;">
		    							<th  class="tr_click" >选择</th>
					    				<th  class="tr_click" >刊名</th>
					    				<th  class="tr_click" >主办单位</th>
		    							<th  class="tr_click" >刊期</th>
		    							<th  class="tr_click" >期均发文</th>
		    							<th  class="tr_click" >核心排序</th>
		    							<th class="tr_click" >刊源收录</th>
		    							<th class="tr_click">重要提示</th>
						    	</tr>
	    					</tbody>
	    				</table>
					</div>
					<div class="paging">
		    				共<font class="paging_font"><span id="s_total"></span></font>页&nbsp<font class="paging_font"><span id="s_totalnum"></span></font> 条记录，当前是第<font class="paging_font"><span id="s_now"></span></font>页
		    				<span id="m_span">
							</span>
	    				</div>
    			</div>
	  	</div>
	  </div>
	    <div id="note_div" class="note_div">
	       	<div id="right_1" class="right_1">
			       		<div class="lf_1_1">页面注释</div>
					    <div id="dp1" clsss="lf_1_2" style="color:#565656;font-size:12px">
							<p id="p1">括号内表示刊物数量，选择恢复周期搜出承诺回复的刊物</p>
							<br/><br/>
						</div>
			</div>
	    	 <div id="note_div" class="note_div">
	    	<div id="right_2" class="right_2">
					<div id="main_body_right" class="main_body_right" style="display:">
						<div class="lf_1_1">排序方法</div>
						<div class="sort_type" onclick="closeM('1')">
							<span >刊源排序</span>
						</div>
						<div id="memd1" class="memd">
								<li class="li_img1"><a href="javascript:sort(1,'北大核心');">北大核心</a></li>
								<li class="li_img1"><a href="javascript:sort(2,'中科院核心');">中科院核心</a></li>
								<li class="li_img1"><a href="javascript:sort(3,'社科院');">社科院</a></li>
								<li class="li_img1"><a href="javascript:sort(4,'南京大学');">南京大学</a></li>
								<li class="li_img1"><a href="javascript:sort(9,'中信所');">中信所</a></li>
								<li class="li_img1"><a href="javascript:sort(5,'综合排序');">综合排序</a></li>
						</div>    							
						<div class="sort_type" onclick="closeM('2')">
							<span >速度排序</span>
						</div>
						<div id="memd2" class="memd">
								<li class="li_img1"><a href="javascript:sort(6,'发表周期');">发表周期</a></li>
								<li class="li_img1" style='display:none'><a href="javascript:sort(7,'初审周期');">初审周期</a></li>
								<li class="li_img1"><a href="javascript:sort(8,'优先出版');">优先出版</a></li>
						</div>
						<div class="sort_type" onclick="closeM('3')">
							<span >发表可能</span>
						</div>
						<div id="memd3" class="memd">
								<li class="li_img1"><a href="javascript:sort(10,'期发文量');">期发文量</a></li>
						</div>
							
    				</div>

			</div> 
	    </div>
    </div>
    <!-- 
	<jsp:include page="/common/buttom.jsp"></jsp:include>
  -->
  </div>
</div>
  
  </body>
  <script type="text/javascript">
  /*定义初始化全局变量*/
   var total;
 var sortClass = "";
 var sortType = 5;
  	function test1(v){
  		document.form1.action = "testAction!prePag2.action?start="+v;
  		document.form1.submit();
  	}
  var ifr = window.frames[0];
  function test2(){
  	// var ifr = window.frames[0];
  		var ifr = document.getElementsByName("iframe1")[0];
  		ifr.src = ifr.src;
  	 //alert(ifr.src);
  }
  function test3(){
  	window.location.href = "<%=basePath%>testAction!preMainPage.action";
  }
   function choseCore(v){
   /*
  	if(v==0) {
  		getId("tr_core1").style.display = "";
  		getId("tr_core2").style.display = "";
  		getId("tr_core3").style.display = "none";
  		getId("tr_core4").style.display = "none";
  		getSelect(0);
  	} else {
   		getId("tr_core3").style.display = "";
  		getId("tr_core4").style.display = ""; 
  		getId("tr_core1").style.display = "none";
  		getId("tr_core2").style.display = "none";
  		getSelect(2);	
  	}
  	*/
  }
  function delthis(obj){
  		var v = obj.value;
  		document.getElementById("checkItem_"+v).checked = false;
  		obj.parentNode.parentNode.removeChild(obj.parentNode.parentNode.firstChild);
  	}
  	/*刊物对比*/
  	function compare(){
		var str = "";
  		var str1="";
  		var $c = $(":checkbox[name=sitem][checked=checked]");
  		var $s = $(":checkbox[name=selectItem]");
  		if($c.length<2) {
			alert("至少要选两种刊物才能对比");
			return false ;
  		}
  		if($c.length>4) {
			alert("最多允许选四种刊物");
			return false ;
  		}
  		$c.each(function(){
  			str+=this.value+";";
  		});
  		$s.each(function(){
  			var sc = this.value.split(";")[0];
  			str1+=sc+";";
  		});
			var url = "businessProcessMainAction!preCompare.action?pubId="+str+"&allpub="+str1;
			windowOpen(url,"compare");  	
  	}
  	/*获取未选中的期刊*/
  	function getIframeCheck(){
  		var ifc = document.getElementsByName("selectItem");
  		var str = "";
  		for(var i=0;i<ifc.length;i++){
  				str += ifc[i].value + "_";
  		}
  		str = str.substring(0,str.length-1);
  		return str ;
  		
  	}
  	function testOK(){
  		var c = document.getElementsByName("sitem") ;
  		if(c == null){
  			return  ;
  		}
 			var cv = "";
 			var allcv = "";
 			var num = c.length;
 			if(num ==0) {
 				alert("请选择刊物");
 				return  ;
 			}
			for(var i=0;i<num;i++) {
				if(c[i].checked){
					cv +=c[i].value+",";
				}
				allcv += c[i].value+",";
				
			}
			
			var pubid = cv.substring(0,cv.length-1);
			var allpub = allcv.substring(0,allcv.length-1);//当页的所有的pubid
			var url = "businessProcessMainAction!preTestSuccess.action?pubid="+pubid;
			windowOpen(url,"compare"); 		
  	}
 
 function closeDiv(){
 	var oDiv = document.getElementById("add_div");
 	if(oDiv != null){
 		document.getElementById("more_div").removeChild(oDiv);
 	}
 }
 
  $(document).ready(function() { 
    $('#button1').click(function() {
    		var pos = getElementPos("td_pos");
	        $.blockUI({ message: $('#div1'),
	        	centerY: 0,
	        	css:{
	        		position:'absolute',
					left:pos.x+'px',
					top:'120px',
					width:'600px',
					height:'400px',
					color:	'#111',
					border: 'none',
					backgroundColor:'#fff'
				}
	         }); 
       // setTimeout($.unblockUI, 2000); 
    }); 
  
    $('#button2').click(function(){
    	$.unblockUI();
    });
    
    $(":checkbox[name=coreItem]").mouseover(function(){
    	$("#p1").css({"font-size":"12px","color":"#0000FF"});
    	$("#p1").text("核心期刊是期刊中学术水平较高的刊物，是我国学术评价体系的一个重要组成部分。它主要体现在对科研工作者学术水平的衡量方面");
    	$("#dp1").css({"overflow":"hidden","height":"200px"});
    });
    $(":checkbox[name=coreItem]").mouseout(function(){
    	$("#p1").css({"font-size":"12px","color":"#565656"});
    	$("#p1").text("括号内表示刊物数量，选择恢复周期搜出承诺回复的刊物");
    	$("#dp1").css({"overflow":"auto","height":"200px"});
    });
    
});
 
 
createView();
function createView(){
	var ov = subjectAllValue;
	var tbody_1 = getId("tbody_1");
	var jsonObj = eval('('+ov+')');
	var j0 = jsonObj[0];
	var j1 = jsonObj[1];
	var len = j0.length;
	var len2 = j1.length;
	var strall = "";
	for(var i=0;i<len;i++){
		var arr1 = new Array();//id 数组
		var arr2 = new Array();	//name 数组
		for(var j=0;j<len2;j++){
			if(j0[i].sid == j1[j].pid){
				arr1.push(j1[j].sid);
				arr2.push(j1[j].name);
			}
		}
		
		var num = Math.ceil(arr1.length/3);
		var row ;
		for(var k=0;k<num;k++){
			if(k<1){
				row = tbody_1.insertRow(-1);
				row.style.backgroundColor="#fffddd";
				var celM=row.insertCell(-1);
				celM.innerText = j0[i].name;
				celM.className="td_m";
				celM.rowSpan = num;
			}else {
				row = tbody_1.insertRow(-1);
				row.style.backgroundColor="#fffddd";
			}
			var cel0 = row.insertCell(-1);
			cel0.innerText = arr2[3*k+0];
			cel0.className = "td_c";
			cel0.onmouseover = function(){this.style.backgroundColor='#FFA22E';event.cancelBubble=true;}; 
			cel0.onmouseout = function (){this.style.backgroundColor='#E6F1D8';event.cancelBubble=true;};
			cel0.id = "td_c_"+arr1[3*k+0];
			cel0.onclick = function(){getCode(this);};
			if((3*k+1)<arr1.length){
				var cel1 = row.insertCell(-1);
				cel1.innerText = arr2[3*k+1];
				cel1.className="td_c";			
				cel1.onmouseover = function(){this.style.backgroundColor='#FFA22E';event.cancelBubble=true;}; 
				cel1.onmouseout = function (){this.style.backgroundColor='#E6F1D8';event.cancelBubble=true;};
				cel1.id = "td_c_"+arr1[3*k+0];
				cel1.onclick = function(){getCode(this);};
					
			}	
			if((3*k+2)<arr1.length){
				var cel2 = row.insertCell(-1);
				cel2.innerText = arr2[3*k+2];
				cel2.className="td_c";	
				cel2.onmouseover = function(){this.style.backgroundColor='#FFA22E';event.cancelBubble=true;}; 
				cel2.onmouseout = function (){this.style.backgroundColor='#EFF6FF';event.cancelBubble=true;};	
				cel2.id = "td_c_"+arr1[3*k+0];
				cel2.onclick = function(){getCode(this);};		
			}	
		}
		
	}
	
}
var inte ;
	/*关闭弹出层*/
	function closeMainDiv(){
		var tr = document.getElementById("tr_sub");
		var ce = tr.cells;
		
		while(tr.childNodes.length>0){
			tr.removeChild(tr.firstChild);
		}
		
		var flag = 0;
		flag = createTrtd();
		if(flag == 1){		
			$.unblockUI();
		}
		return false ;
	}
	
	function createTrtd(){
		var l = document.getElementById("tr_div_top");
	 	var l2 = document.getElementById("tr_div_top2");
	 	var c1 = l.getElementsByTagName("input");
	 	var c2 = l2.getElementsByTagName("input");	
	 	var row_tr = document.getElementById("tr_sub");
	 	//alert(row_tr.childNodes.length);
	 	//alert(row.childNodes.length);
	 	
		for(var i=0;i<c1.length;i++){
			var txt = document.getElementById("lcd_"+c1[i].value).innerText;
			var celu = row_tr.insertCell(-1);
			celu.style.color = "#0000FF";
			celu.id = "tdAdd_"+c1[i].value;
			celu.innerHTML = "<input type='checkbox' name='cc' checked='true' onclick='del(this);' value='"+c1[i].value+"'/>"+txt;
		}
		
		for(var i=0;i<c2.length;i++){
			var txt = document.getElementById("lcd_"+c2[i].value).innerText;
			var celd = row_tr.insertCell(-1);
			celd.style.color = "#0000FF";
			celd.id = "tdAdd_"+c2[i].value;
			celd.innerHTML = "<input type='checkbox' name='cc'  checked='true' onclick='del(this);'  value='"+c2[i].value+"'/>"+txt;
		}	
		return 1 ; 	
	}

function del(obj){
	var row  = document.getElementById("tr_sub");
	row.removeChild(obj.parentNode)
	var id = "cid_"+obj.value;
	var c = document.getElementById(id);
	c.parentNode.parentNode.removeChild(c.parentNode);
}	

function getCode(obj){
	var oDiv = document.getElementById("add_div");
	$("#add_div").remove();
	var ov = subjectAllValue;
	var j = eval('('+ov+')');
	var jsonObj = j[2];
	var oid = obj.id;
	var v = oid.substr(5);
 	var pos = getElementPos(oid);
 	var d = document.createElement("div");
 	d.id="add_div";
 	d.style.position ="absolute";
 	d.style.left = obj.offsetLeft+10;
 	d.style.top = obj.offsetTop+15;
 	d.style.backgroundColor="red";
 	d.style.width = "100%";
 	d.style.zIndex="2002";
 	d.innerHTML =(getStr(v));
 	obj.appendChild(d);
}
function getStr(id){
	var v = id;
	var str_s = "<table name='table_add' id='table_add' class='add_table'  >";
	var str_e = "</table>";
	var ov = subjectAllValue;
	var j = eval('('+ov+')');
	var jsonObj = j[2];
	var str_all = "";
	var len = jsonObj.length;
	for(var i=0;i<len;i++){
			var str_tr1 = "<tr>";
			var str_tr2 = "</tr>";
			var str_main="";
			var str_main1="";
			var pid = jsonObj[i].pid;
			if(pid == v) {
				var s1 = "<tr>";
				var s2 = "</tr>";
				str_tr="<td onclick='event.cancelBubble=true;' onmouseover='t(this);' onmouseout='tz(this);' class='td_add_div'><input type='checkbox' event.cancelBubble=true; name='c' value="+jsonObj[i].sid+" id='id_"+jsonObj[i].sid+"' /><label id='la_"+ jsonObj[i].sid +"' for='id_"+jsonObj[i].sid+"'>"+jsonObj[i].name+"</label></td>";
				str_main+=str_tr;
				str_main1 = s1+str_main+s2;
			}
			
		str_all += str_main1;
	}		
	var str = "";
	var sbutton = "<tr><td><input type='button' name='buttonDiv' value='确定' onclick='removeTable();' /></td></tr>";
	str = str_s + str_all +sbutton+ str_e;
	return str;

}
function t(obj){
	//FFA22E
	obj.style.backgroundColor='#63B8FF';
}
function tz(obj){
	obj.style.backgroundColor='#E0EEE0';
}
 function fawen(v){
		var url = "businessProcessMainAction!preFaWen.action?fawenType="+v;
		window.location.href = url;
		//windowOpen(url,"fawen"); 	
 }
 function sort(v,t){
 		/*
 		if(checkLogin(callajaxSort2,v)){
	  		getId("span_1").innerText = "  按 "+ t +" 筛选排序";
	  		callajaxSort2(v);
 		}
 		*/
 		checkLogin("callajaxSort2",v);
 		getId("span_1").innerText = "  按 "+ t +" 筛选排序";
 }
 function removeTable(){
	var l = document.getElementById("tr_div_top");
	var l2 =  document.getElementById("tr_div_top2");
 	var len = (l.getElementsByTagName("input").length + l2.getElementsByTagName("input").length);
 	var c = document.getElementsByName("c");
 	if(c != null) {
 		var strf = "";
 		var t = document.getElementById("tr_div_top");
 		var t1 = document.getElementById("tr_div_top2");
 		var num =0;
		if(len > 5){
			alert("最多选5项");
		}else if(len>0 && len<=5){
			num = len ;
	 		for(var i =0;i<c.length;i++){
	 			if(c[i].checked && getNums(c[i])==0 ){
	 				num++;
	 				if(num<4){
		 				var la = "la_"+c[i].value;
		 				var txt = document.getElementById(la).innerText;
		 				var cel = t.insertCell(-1);
		 				var str = "<td><input type='checkbox' checked='true' id='cid_"+c[i].value+"' onclick='removeCheck(this);' value='"+c[i].value+"'/><label id='lcd_"+c[i].value+"' for='cid_"+c[i].value+"'>"+txt+"</label></td>";
		 				cel.innerHTML = str;
	 				}
	 				
	 				if(num>=4 && num<6){
		 				var la = "la_"+c[i].value;
		 				var txt = document.getElementById(la).innerText;	 				
	 					var cel = t1.insertCell(-1);
	 					cel .innerHTML = "<td colspan='3'><input type='checkbox' checked='true' id='cid_"+c[i].value+"' onclick='removeCheck(this);' value='"+c[i].value+"'/><label id='lcd_"+c[i].value+"' for='cid_"+c[i].value+"'>"+txt+"</label></td>";
	 				}
	 				
	 			}
	 		}		
			
		}else if(len == 0){
			for(var i =0;i<c.length;i++){
				if(c[i].checked && getNums(c[i])==0 ){
	 				num++;
	 				if(num<4){
		 				var la = "la_"+c[i].value;
		 				var txt = document.getElementById(la).innerText;
		 				var cel = t.insertCell(-1);
		 				var str = "<td><input type='checkbox' checked='true' id='cid_"+c[i].value+"' onclick='removeCheck(this);' value='"+c[i].value+"'/><label id='lcd_"+c[i].value+"' for='cid_"+c[i].value+"'>"+txt+"</label></td>";
		 				cel.innerHTML = str;
	 				}
	 				
	 				if(num>=4 && num<6){
		 				var la = "la_"+c[i].value;
		 				var txt = document.getElementById(la).innerText;	 				
	 					var cel = t1.insertCell(-1);
	 					cel .innerHTML = "<td colspan='3'><input type='checkbox' checked='true' id='cid_"+c[i].value+"' onclick='removeCheck(this);' value='"+c[i].value+"'/><label id='lcd_"+c[i].value+"' for='cid_"+c[i].value+"'>"+txt+"</label></td>";
	 				}
	 				
	 			}			
			}
		}

 	}
 	$("#add_div").remove();
 }
 
 function getNums(obj){
 	var l = document.getElementById("tr_div_top");
 	var l2 = document.getElementById("tr_div_top2");
 	var c1 = l.getElementsByTagName("input");
 	var c2 = l2.getElementsByTagName("input");
 	var flag =0;
 	var flag1 =0;
 	for(var i=0;i<c1.length;i++){
 		if(obj.value == c1[i].value) {
 			flag = 1;
 			break;
 		}
 	}
 	for(var i=0;i<c2.length;i++){
 		if(obj.value == c2[i].value) {
 			flag1 = 1;
 			break;
 		}
 	} 	
 	if(flag==1 || flag1 == 1) return 1;
 	return 0;
 }
 
 function removeCheck(obj){
 	obj.parentNode.parentNode.removeChild(obj.parentNode);
 }
 var lookup ;
$(document).ready(function(){
	/*
  		$.ajax({
  			type:"post",
  			url:"commonCallServiceAction!getLookUpMap.action",
  			data:{key:"'1R','1S'"},
  			dataType:"json",
  			success:function(data){
  				lookup = "";
  				lookup = data;
  				getSelect(0);
  			}
  		});
  	*/	
  		$.ajax({
  			type:"post",
  			url:"businessProcessMainAction!preMainDefault2.action",
  			data:{},
  			dataType:"json",
  			success:function(data,status){
  				createTable(data);
  				
  			}
  		
  		});
  		
  	});
  	 function getSelect(v){
  	 	var oSelect = document.getElementsByName("typeArt")[0];
  		oSelect.length = 0;
  	 	if(v ==0){
  	 		for(i in lookup){
  	 			if(i.indexOf("1R") != -1){
  	 				var op = document.createElement("option");
  	 				op.value = i;
  	 				op.innerText = lookup[i];
  	 				oSelect.appendChild(op);
  	 			}
  	 		}
  	 	}else {
			for(i in lookup){
  	 			if(i.indexOf("1S") != -1){
  	 				var op = document.createElement("option");
  	 				op.value = i;
  	 				op.innerText = lookup[i];
  	 				oSelect.appendChild(op);
  	 			}
  	 		}  	 		
  	 	}
  	 }
 

 /*---------------------------
    功能:停止事件冒泡
    ---------------------------*/
    function stopBubble(e) {
        //如果提供了事件对象，则这是一个非IE浏览器
        if ( e && e.stopPropagation )
            //因此它支持W3C的stopPropagation()方法
            e.stopPropagation();
        else
            //否则，我们需要使用IE的方式来取消事件冒泡
            window.event.cancelBubble = true;
    }
    //阻止浏览器的默认行为
    function stopDefault( e ) {
        //阻止默认浏览器动作(W3C)
        if ( e && e.preventDefault )
            e.preventDefault();
        //IE中阻止函数器默认动作的方式
        else
            window.event.returnValue = false;
        return false;
    }

 function createTable(lists){
 	var list = lists["content"];
 	var tbody = document.getElementById("tbody1");
 	
	 	while(tbody.childNodes.length>1){
	 		tbody.removeChild(tbody.lastChild);
	 	}
 	
 	for(var i=0;i<list.length;i++){
 		var tr = tbody.insertRow(-1);
 		var c0 = tr.insertCell(-1);
 		c0.innerHTML = "<input type='checkbox' name='selectItem' value='"+list[i][8]+";"+list[i][1]+"' id='checkItem_"+list[i][7]+"' onclick='addItem(this);' />";
 		var c1 = tr.insertCell(-1);
 		c1.innerHTML = "<a href='javascript:openDetail(\""+list[i][8]+"\")' style='text-decoration: none'>"+list[i][1] +"</a>";
 		var c2 = tr.insertCell(-1);
 		c2.innerHTML = list[i][2];
 		var c3 = tr.insertCell(-1);
 		c3.innerHTML = list[i][3];
 		var c4 = tr.insertCell(-1);
 		c4.innerHTML = list[i][4];
 		var c5 = tr.insertCell(-1);
 		var s ="";
 		s = list[i][5]=="9999/0"?"0/0":list[i][5];
 		c5.innerHTML = "<a href='javascript:openSub(\""+list[i][8]+"\")' style='text-decoration: none'>"+s +"</a>";
 		var c6 = tr.insertCell(-1);
 		//c6.innerHTML = list[i][6];
 		c6.innerHTML =getSource(list[i][6]);
 		var c7 = tr.insertCell(-1);
 		if(list[i][7] == "Y")	{ 		
 			c7.innerHTML = '<img alt="有重要提示信息" src="images/main/information.png">';
 		} else {
 			c7.innerHTML = "";
 		}
 	}
	changeColor();
	createPage(lists["pageVO"]);
 }
 function getSource(v){
 	var arr = v.split(";");
 	var strs = "";
 	for(var i=0;i<arr.length;i++){
 		var str = "<a style='margin-left:5px' href='javascript:selectSource(\""+arr[i]+"\")'>"+arr[i]+"</a>";
 		strs += str ;
 	}
 	return strs ;
 
 }
 function selectSource(v){
   		var url = "businessProcessMainAction!preSourceOther.action?pubid="+v;
  		windowOpen(url,'detail');
 }
 function createPage(pageobj){
 	$("#s_total").html(pageobj.totalPage);
 	$("#s_totalnum").html(pageobj.totalNum);
 	$("#s_now").html("<font color='red'>"+pageobj.now+"</font>");
 	total = pageobj.totalPage;
 	var s = "";
 	var s1 = '<a href="javascript:page(1);">首页</a>';
 	var s2 = '<a href="javascript:page('+pageobj.now+'-1 );">上一页</a>';
    var s4 = '<a href="javascript:page('+pageobj.now+'+1 );">下一页</a>';
    var s5 = '<a href="javascript:page('+pageobj.totalPage+');">最后一页</a>'
 	for(var i=pageobj.beginPage;i<=pageobj.endPage;i++){
 		if(i == pageobj.now) {
 			s += '<font color="red">&nbsp&nbsp'+i+'&nbsp</font>';
 		}else {
 			 s += '<a href="javascript:page('+i+' );">'+i+' </a>' ;
 		}
 	}
 	var str = s1+s2+s+s4+s5;
 	$("#m_span").html(str);
 }
 function page(v){
		v = (v<1)?1:v;
		v = (v > total)?total : v;
		if(checkForPage(v))
		callajaxpage(v);
	}
function callajaxpage(now){
	$.ajax({
			type:"post",
			url:"businessProcessMainAction!preMainDefault2.action",
			data:{"sortClass":sortClass,"sort":sortType,"now":now},
			dataType:"json",
			success:function(data){
				createTable(data);
			}
		}); 	
}
	
 var v1=0,v2=0,v3=0;
 function sortAgain(obj,v){
	 var $td = $("#tr_title>th");
	 $td.each(function(){
	 	if($(this).get(0) != obj){
	 		$(this).attr("class","tr_click");
	 	}
	 });
	  var num =0;
	 if(v == 1){
	 	v1++;
	 	num= v1%2==1?2:1;
	 }
	 if(v == 2) {v2++;	num= v2%2==1?5:4;}
	 if(v == 3) {v3++; 	num= v3%2==1?8:7;}
	
 	if(obj.className == "tr_click"){
 		obj.className = "sort_th";
 	}else if(obj.className == "sort_th") {
 		obj.className = "sort_th2";
 	}else if(obj.className == "sort_th2"){
 		obj.className = "sort_th";
 	}
 	callajaxSort(num);
 }

 function callajaxSort(v){
 	getId("span_1").innerText = "";
 	sortClass = v;
  	$.ajax({
			type:"post",
			url:"businessProcessMainAction!preMainDefault2.action",
			data:{"sortClass":v,"sort":sort},
			dataType:"json",
			success:function(data){
				createTable(data);
			}
		}); 
 }
 function callajaxSort2(sort){
 	sortType = sort;
  	$.ajax({
			type:"post",
			url:"businessProcessMainAction!preMainDefault2.action",
			data:{"sort":sort},
			dataType:"json",
			success:function(data){
				createTable(data);
			}
		}); 
 }
 
 
 function changeColor(){
	$(function(){
		$("#tbody1>tr:odd").addClass("odd");
		$("#tbody1>tr:even").addClass("even");
	});  	
	$("#tbody1>tr[id!='tr_title']").hover(
		function(){
			$(this).addClass("selected2");
		},
		function(){
			$(this).removeClass("selected2");
		}
	); 	
 }
 function addItem(obj){
  		var so = document.getElementsByName("selectItem");
  		var num = 0;
  		for(var i=0;i<so.length;i++){
  			if(so[i].checked) {
  				num++;
  			}
  		}
		if(num>maxcompItem){
  			alert("最多只能选择"+maxcompItem+"项");
  			obj.checked = false ;
  			return false ;
  		}  		

		var arr = obj.value.split(";");
		var v  = arr[0];
		var t = arr[1];
		var flag = true;
		$(":checkbox[name=sitem]").each(function(){
			if(obj.checked &&  this.id.split("_")[1] == v) {
				//obj.checked = false ;
				flag = false ;
				return false ;		
			 }
		});
		if(flag){
			if(obj.checked){
				var str = "<input type='checkbox' name='sitem' id='cid_"+v+"'  value='"+v+"' checked='true'  onclick='delthis(this);' />";
				var r = document.getElementById("c_table").insertRow(-1);//-1是为了兼容firefox
				r.id = "tr_"+v;
				var ctd = r.insertCell(-1);//-1是为了兼容firefox
				ctd.className="td_font";
				var l = "<label for='cid_"+v+"'>"+t+"</label>";
				ctd.innerHTML = str+l;
			}else {
				var ocheck =  document.getElementById("tr_"+v);
				if(ocheck!= null){
					document.getElementById("c_table").removeChild(ocheck);
				}
			}			
		}

  	}
  	function openDetail(v){
  		var url = "businessJournalAction!preJournaleDetail.action?pubid="+v;
  		windowOpen(url,'detail');
  	} 
  	
  	 var zTreeObj;
	   var setting = {
	   	check: {
				enable: true,
				chkboxType: {"Y":"ps", "N":"ps"}
			},
		callback: {
			onCheck: zTreeOnCheck
		}
	   };
	   
	   function zTreeOnCheck(event, treeId, treeNode) {
    		//alert(treeNode.tId + ", " + treeNode.name + "," + treeNode.checked);
    		var nodes = zTreeObj.getCheckedNodes(true);
    		$("#tree_text").html("");
    		var strid="";
    		var strtext="";
    		$(nodes).each(function(){
    			if(this.isParent) {
    				$("#tree_text").append("<p style='color:red'>"+this.name+"</p>");
    			}else{
    				$("#tree_text").append("<p style='margin-left:10px'>"+this.name+"</p>");
    				strid+=this.id+",";
    				strtext+=this.name+",";
    			}
				
    			$("#cc").val(strid);
    			$("#div_sub").html("<p style='color:#0000FF;font-size:11px;text-align:left'><font style='font-size:12px;color:red'>所选学科：</font>"+strtext+"</p>");
    			//$("#div_sub").val(strtext);
    		});
		};
	   
	   
  	/*选择学科*/
  	function selectSub(v){
  		var url = v==1?"queryInfoAction!querySubForJiaoYu.action":"queryInfoAction!querySubForZhongTu.action";
  		var dwidth= v==1?"500px":"700px";
  		var dheight= v==1?"400px":"420px";
  		if(v==1){
  			$("#d_title").html("<b>教育部分类法</b>");
  			$("#div2").css({width:"700px"});
  			$("#tree_div").css({width:"220px","overflow-x":"auto"});
  			$("#tree_text").css({ width: "320px",height:"400px", "margin-left":"10px" }); 
  		}else {
  			$("#d_title").html("<b>中图分类法</b>");
  			$("#div2").css({width:"700px"});
  			$("#tree_div").css({width:"220px","overflow-x":"auto"});
  			$("#tree_text").css({ width: "320px",height:"400px", "margin-left":"10px","overflow-x":"auto" }); 
  		}
  		$.ajax({
			type:"post",
			url:url,
			dataType:"json",
			success:function(data){
				zTreeObj = $.fn.zTree.init($("#treeDemo"), setting, data);
				$("#ccType").val(v);
			}
		}); 
  	
	   var pos = getElementPos("td_pos");
       $.blockUI({ message: $('#div2'),
       	centerY: 0,
       	css:{
       		position:'absolute',
			left:pos.x+'px',
			top:'120px',
			width:dwidth,
			height:dheight,
			color:	'#111',
			border: 'none',
			backgroundColor:'#fff'
		}
        }); 
  	
  	}
 function closeM(v){
 	$("#memd"+v).toggle();
 }  	
  function checkForPage(v){
  	if((v-1)!=0){
  		checkLogin("callajaxpage",v);
  	}else {
  		callajaxpage(v);
  	} 
  	
  }	
  
  /* 检查用户是否已登录  */
  function checkLogin(callBackFunction,v){
		$.ajax({
  			type:"post",
			url:"businessProcessMainAction!checkUserLogin.action",
			dataType:"text",
			success:function(data){
				if(data != "000000"){
					login();
					return false;
				}else {
					if(v=="" || v=="undefined" || v==null) {
						eval('callBackFunction()');
					}else {
						var str = callBackFunction +"("+v+")";
						eval(str);
					}
				}
				
			}
  		});  	
  }
  
  function login(){
  			$("#custName").val("");
  			 $("#passWord").val("");
  			var pos = getElementPos("td_pos");
	        $.blockUI({ message: $('#div3'),
	        	centerY: 0,
	        	css:{
	        		position:'absolute',
					left:pos.x+200+'px',
					top:'220px',
					width:'400px',
					height:'150px',
					color:	'#111',
					border: '1px solid  #0000FF',
					backgroundColor:'#fff'
				}
	         }); 
  }
  function loginUser(){
  			var options = {
				success:showResponse,
				type:'post',
				dataType:'text',
				url:'businessProcessMainAction!commonUserLogin.action'
			};
			if(  $("#custName").val() == "" || $("#passWord").val() ==""  ){
			 	alert("用户名或密码不能为空");
			 	return ;
			 }
			$("#form3").ajaxSubmit(options);
  }
  function showResponse(responseText,statusText){
  	if(statusText == "success" && responseText=="000000"){
  		$.unblockUI();
	}else {
		alert("登录失败");
	}
  }	 	
  function loginOut(){
  	$.unblockUI();
  }
  function openSub(v){
  		var url = "businessProcessMainAction!preSubOther.action?pubid="+v;
  		windowOpen(url,'detail');
  }
  </script>
</html>
